



//
//  GetRentSource.m
//  住房条件帅选器
//
//  Created by MB__Lee on 2018/5/19.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "GetRentSource.h"

#import "BaseModel.h"

@implementation GetRentSource

-(void)priceTableview_getRentSourceWithCategory:(NSString *)category success:(MBSuccessBlock)succese failure:(MBFailure)failure{
    
    NSDictionary *dic =@{@"category":category,
                         @"type":@"rent",
                         @"city":MBCityCode
                         };
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:dic];
    NSMutableArray *mut  =[NSMutableArray array];
    [MBNetTool MBPost:Search_show paramater:dict success:^(id response) {
        if ([response[@"code"] integerValue] == 10000) {
         
            for (NSDictionary *modelDict in response[@"data"]) {
                BaseModel *model = [[BaseModel alloc] initWithDictionary:modelDict error:nil];
                model.isRent = YES;
                [mut addObject:model];
            }
            if (succese) {
                succese(mut);
            }
            
        }
    } failure:^(NSError *error) {
        failure(error);
        
    }];
}

@end
